#pragma once

#include <vector>

/**
 * interface
 * each frame has a set of objects, with each object is associated with an id 
 * and each frame is accociated with an id
 *
 * it can be represented by a table with three columns <frameId, objectId, object>
 *
 */
template<typename TObject>
class MultipleFrameIndexedObjectsViewer {

public:
	virtual ~MultipleFrameIndexedObjectsViewer<TObject>(void) {
	}

public:

	virtual std::vector<int> getAllFrameIds() const = 0;

	virtual std::vector<int> getAllObjectIdsInFrame(int frame) const = 0;

	virtual void getIndexedObjectsByFrameId(
		int frameId, 
		std::vector<int>& objectIds, 
		std::vector<TObject>& objects) const = 0;

	virtual std::vector<TObject> getIndexedObjectsSubsetInFrame(int frameId, const std::vector<int>& objectIds) const = 0;

	virtual void getIndexedObjectsByObjectId(int objectId, std::vector<int>& frameIds, std::vector<TObject>& objects) const = 0;

	virtual TObject getObjectByFrameIdAndObjectId(int frameId, int objectId) const = 0;


public:
	struct Item {
		int frameId;
		int objectId;
		TObject object;
	};

	class ItemIterator {
		virtual bool hasNext() = 0;
		virtual Item next() = 0;
	};

	virtual ItemIterator* getItemIterator() = 0;
};


